import axios from './axios'

export const getMenu = (param) => {
    return axios.request({
        url: '/permission/getMenu',
        method: 'post',
        data: param
    })
}
export const getData = () => {
    return axios.request({
        url: '/home/getData',
    })
}
export const getBooks = () => {
    return axios.request({
        url: 'api/books',
    })
}

/**
 * 获取用户列表
 * @param params
 * @returns {*}
 */
export const getUserList = (params) => {
    return axios.request({
        url: '/user',
        method: 'get',
        data: params
    })
}

/**
 * 修改用户信息
 * @param params
 * @returns {*}
 */
export const editUser = (params) => {
    return axios.request({
        url: '/user',
        method: 'put',
        data: params
    })
}
/**
 * 新增用户信息
 * @param params
 * @returns {*}
 */
export const addUser = (params) => {
    return axios.request({
        url: '/user',
        method: 'post',
        data: params
    })
}

/**
 * 删除用户
 * @param params
 * @returns {*}
 */
export const deleteUser = (params) => {
    return axios.request({
        url: '/user',
        method: 'delete',
        data: params
    })
}

